<!DOCTYPE html>
<html>
<head>
    <title>文件上传</title>
</head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<script>
    $(document).ready(function(){
        $("#i5").click(function(){
            $.post("http://localhost:8080/music",{
                    musicname:"$('#i1').val()",
                    singer:"$('#i2').val()",
                    picture_url:"C://Users//LYQ//IdeaProjects//lyq-study//db//src//main//resources//static//tracks",
                    upload_date:"$('#i2').text()"
                },
                function(data,status){
                    alert("数据上传状态: " + status);
                });
        });
    });
</script>
<style>
    div#d1{
        font-family:"Times New Roman",Times,serif;
        background-image:url('bg/bg2.jpg');
        position: relative;
        left:33%;
        top:60px;
        width:445px;
        height: 350px;
        padding: 30px;
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    }

</style>
</head>
<body>

<div id=d1>
    <span>请输入歌曲信息:</span>
    <form method="POST" enctype="multipart/form-data"
          action="/upload/batch">
        <ul style="list-style-type: circle;">
            <li>歌名：<input id="i1" type="text" /></li><br>
            <li>歌手：<input id="i2" type="text" /></li><br>
            <li>图片：<input type="file" name="file" /></li><br>
            <li>文件：<input type="file" name="file" /></li><br>
        </ul>
        <p style="text-align: center;"><input id="i5" type="submit" value="上传" style="width: 100px;"/></p>
    </form>
</div>

</body>
</html>